﻿/********************************************************************************** 
     * 开发人:邱慕夏
     * 开发组： 
     * 类说明：  
     * 开发时间：2015/11/23 14:19:11 
     *开发版本：V1.0
 **********************************************************************************/

using Model;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading;

namespace DAL
{
    public class StudentBindPaperTypeDAL
    {
        private SQLHelper sqlhelper = null;
        public StudentBindPaperTypeDAL()
        {
            sqlhelper = new SQLHelper();
        }


        #region 根据学生的ID抽提的时候进行查询的sql语句---邱慕夏--2015年11月22日
        /// <summary>
        /// 根据学生的ID抽提的时候进行查询的sql语句---邱慕夏--2015年11月22日
        /// </summary>
        /// <param name="studentinfo">学生的ID</param>
        /// <returns></returns>
        public DataTable SelectAllMajor(String studentID)
        {
            DataTable dt = new DataTable();
            string sql = "select PaperType,CollegeID from StudentBindPaperTypeEntity where StudentID=@StudentID and IsUse=@IsUse";
            SqlParameter[] paras = new SqlParameter[] {
                new SqlParameter ("@StudentID",studentID),
                new SqlParameter ("@IsUse",'1')};
            dt = sqlhelper.ExecuteQuery(sql, paras, CommandType.Text);
            return dt;
        }
        #endregion

        #region 根据学生的ID抽提的时候进行查询的sql语句---邱慕夏--2015年11月22日
        /// <summary>
        /// insert--邱慕夏
        /// </summary>
        /// <param name="studentinfo"></param>
        /// <returns>是否添加成功</returns>
        public int InsertRecord(StudentBindPaperTypeEntity studentBindPaperType)
        {
            string sql = "Insert into StudentBindPaperTypeEntity(StudentID,PaperType,IsUse,CollegeID) values(@StudentID,@PaperType,@IsUse,@CollegeID)";
            SqlParameter[] paras = new SqlParameter[]{
                new SqlParameter("@studentID",studentBindPaperType.StudentID),
                new SqlParameter ("@PaperType",studentBindPaperType.PaperType),
                new SqlParameter ("@IsUse",studentBindPaperType.IsUse),
                new SqlParameter ("@CollegeID",studentBindPaperType.CollegeID)
            };
            int flag = sqlhelper.ExecuteNonQuery(sql, paras, CommandType.Text);
            return flag;
        }
        #endregion

        #region 根据学生的ID去重---邱慕夏--2015年11月22日
        /// <summary>
        /// select--邱慕夏
        /// </summary>
        /// <param name="studentinfo"></param>
        /// <returns>是否已经存在</returns>
        public Boolean SelectRecord(StudentBindPaperTypeEntity studentBindPaperType)
        {
            string sql = "Select * from StudentBindPaperTypeEntity where StudentID=@studentID";
            SqlParameter[] paras = new SqlParameter[]{
                new SqlParameter("@studentID",studentBindPaperType.StudentID),
            };
            DataTable dt = sqlhelper.ExecuteQuery(sql, paras, CommandType.Text);
            if (dt.Rows.Count == 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
        #endregion

        #region 批量根据学生的ID抽提的时候进行查询的sql语句---邱慕夏--2015年11月22日
        /// <summary>
        /// insert--邱慕夏
        /// </summary>
        /// <param name="studentinfo"></param>
        /// <returns>是否添加成功</returns>
        public int InsertRecordList(List<StudentBindPaperTypeEntity> studentBindPaperTypeList)
        {
            int flag = 0;
            for (int i = 0; i < studentBindPaperTypeList.Count; i++)
            {

                string sql = "Insert into StudentBindPaperTypeEntity(StudentID,PaperType,IsUse,CollegeID,TimeTamp,IP,ExamModel) values(@StudentID,@PaperType,@IsUse,@CollegeID,CONVERT(varchar(100), GETDATE(), 20),@IP,@ExamModel)";
                SqlParameter[] paras = new SqlParameter[]{
                new SqlParameter("@studentID",studentBindPaperTypeList[i].StudentID),
                new SqlParameter ("@PaperType",studentBindPaperTypeList[i].PaperType),
                new SqlParameter ("@IsUse",studentBindPaperTypeList[i].IsUse),
                new SqlParameter ("@CollegeID",studentBindPaperTypeList[i].CollegeID),
                new SqlParameter ("@IP",studentBindPaperTypeList[i].IP),
                new SqlParameter("@ExamModel",studentBindPaperTypeList[i].ExamModel)
                //new SqlParameter ("@TimeTamp",studentBindPaperTypeList[i].TimeTamp)
                };
                flag = sqlhelper.ExecuteNonQuery(sql, paras, CommandType.Text);
            }
            return flag;
        }
        #endregion

        #region 根据时间戳查询在考人数的sql语句---赵寒--2016年1月4日08:35:52
        /// <summary>
        /// insert--赵寒
        /// </summary>
        /// <param name="studentinfo"></param>
        /// <returns>在考人数</returns>
        public DataTable OnLineCount(StudentBindPaperTypeEntity studentBindPaperType,TimeEntity timeEntity)
        {
            //string sql = "select count(*) from StudentBindPaperTypeEntity where TimeTamp>=@timetamp and IsUse='1'";
            string sql = "select count(*) from StudentBindPaperTypeEntity where TimeTamp between @timetamp and @EndDateTimep and IsUse='1'";
            SqlParameter[] paras = new SqlParameter[]{
                new SqlParameter ("@timetamp",studentBindPaperType.TimeTamp),
                new SqlParameter ("@EndDateTimep",timeEntity.EndDateTime)
            };
            DataTable dt = sqlhelper.ExecuteQuery(sql, paras, CommandType.Text);
            return dt;


        }
        #endregion

        #region 根据时间戳查询本场或本考场所有考试人员--吕德彪--2018
        /// <summary>
        /// 
        /// </summary>
        /// <param name="studentBindPaperType"></param>
        /// <param name="timeEntity"></param>
        /// <returns>本场所有考生人数</returns>
        public DataTable AllCount(StudentBindPaperTypeEntity studentBindPaperType, TimeEntity timeEntity)
        {
            string sql = "select count(*) from StudentBindPaperTypeEntity where TimeTamp between @timetamp and @EndDateTimep";
            SqlParameter[] paras = new SqlParameter[]{
                new SqlParameter ("@timetamp",studentBindPaperType.TimeTamp),
                new SqlParameter ("@EndDateTimep",timeEntity.EndDateTime)
            };
            DataTable dt = sqlhelper.ExecuteQuery(sql, paras, CommandType.Text);
            return dt;
        }
        #endregion

        #region 根据时间戳查询本考场在线考生人数--吕德彪--2018
        /// <summary>
        /// 
        /// </summary>
        /// <param name="studentBindPaperType"></param>
        /// <param name="timeEntity"></param>
        /// <returns>本考场在线考生人数</returns>
        public DataTable ExamPlaceOnlineCount(StudentBindPaperTypeEntity studentBindPaperType, TimeEntity timeEntity, string strPlace)
        {
            string sql = "select count(*) from StudentBindPaperTypeEntity as a INNER JOIN StudentInfoEntity as b ON a.StudentID=b.studentID INNER JOIN IPEntity as c ON b.examPlaceID = c.ipName where b.examPlaceID = @place and TimeTamp between @timetamp and @EndDateTimep and IsUse = '1'";
            SqlParameter[] paras = new SqlParameter[]{
                new SqlParameter ("@timetamp",studentBindPaperType.TimeTamp),
                new SqlParameter ("@EndDateTimep",timeEntity.EndDateTime),
                new SqlParameter("@place",strPlace)
            };
            DataTable dt = sqlhelper.ExecuteQuery(sql, paras, CommandType.Text);
            return dt;
        }
        #endregion

        #region 根据时间戳查询本考场所有考试人员--吕德彪--2018
        /// <summary>
        /// 
        /// </summary>
        /// <param name="studentBindPaperType"></param>
        /// <param name="timeEntity"></param>
        /// <returns>本场所有考生人数</returns>
        public DataTable ExamPlaceCount(StudentBindPaperTypeEntity studentBindPaperType, TimeEntity timeEntity, string strPlace)
        {
            string sql = "select count(*) from StudentBindPaperTypeEntity as a INNER JOIN StudentInfoEntity as b ON a.StudentID=b.studentID INNER JOIN IPEntity as c ON b.examPlaceID = c.ipName where b.examPlaceID = @place and TimeTamp between @timetamp and @EndDateTimep";
            SqlParameter[] paras = new SqlParameter[]{
                new SqlParameter ("@timetamp",studentBindPaperType.TimeTamp),
                new SqlParameter ("@EndDateTimep",timeEntity.EndDateTime),
                new SqlParameter("@place",strPlace)
            };
            DataTable dt = sqlhelper.ExecuteQuery(sql, paras, CommandType.Text);
            return dt;
        }
        #endregion

        #region 根据时间戳查询本考场已交卷考生人数--吕德彪--2018
        /// <summary>
        /// 
        /// </summary>
        /// <param name="studentBindPaperType"></param>
        /// <param name="timeEntity"></param>
        /// <returns>本考场已交卷考生人数</returns>
        public DataTable SubmittedCount(StudentBindPaperTypeEntity studentBindPaperType, TimeEntity timeEntity, string strPlace)
        {
            string sql = "select count(*) from StudentBindPaperTypeEntity as a INNER JOIN StudentInfoEntity as b ON a.StudentID=b.studentID INNER JOIN IPEntity as c ON b.examPlaceID = c.ipName where b.examPlaceID = @place and TimeTamp between @timetamp and @EndDateTimep and IsUse ='0'";
            SqlParameter[] paras = new SqlParameter[]{
                new SqlParameter ("@timetamp",studentBindPaperType.TimeTamp),
                new SqlParameter ("@EndDateTimep",timeEntity.EndDateTime),
                new SqlParameter("@place",strPlace)
            };
            DataTable dt = sqlhelper.ExecuteQuery(sql, paras, CommandType.Text);
            return dt;
        }
        #endregion

        #region 根据时间戳查询本考场文件未上传成功的考生人数--吕德彪--2018
        /// <summary>
        /// 
        /// </summary>
        /// <param name="studentBindPaperType"></param>
        /// <param name="timeEntity"></param>
        /// <returns>本考场文件未上传成功的考生人数</returns>
        public DataTable UnUploadCount(StudentBindPaperTypeEntity studentBindPaperType, TimeEntity timeEntity, string strPlace)
        {
            
            //string sql = "select count(*) from StudentBindPaperTypeEntity where TimeTamp between @timetamp and @EndDateTimep and IP like @place and IsUse = '2'";
            string sql = "select count(*) from StudentBindPaperTypeEntity as a INNER JOIN StudentInfoEntity as b ON a.StudentID=b.studentID INNER JOIN IPEntity as c ON b.examPlaceID = c.ipName where b.examPlaceID = @place and TimeTamp between @timetamp and @EndDateTimep and IsUse = '2'";
            SqlParameter[] paras = new SqlParameter[]{
                new SqlParameter ("@timetamp",studentBindPaperType.TimeTamp),
                new SqlParameter ("@EndDateTimep",timeEntity.EndDateTime),
                //new SqlParameter("@place",strPlace+"%")
                new SqlParameter("@place",strPlace)
            };
            DataTable dt = sqlhelper.ExecuteQuery(sql, paras, CommandType.Text);
            return dt;
        }
        #endregion

        #region 根据时间戳查询未交卷学生的sql语句---赵寒--2016年1月4日08:35:52
        /// <summary>
        /// insert--赵寒
        /// </summary>
        /// <param name="studentinfo"></param>
        /// <returns>在考人数</returns>
        public DataTable OnLineStudent(StudentBindPaperTypeEntity studentBindPaperType)
        {
            string sql = "select studentID as '学号',IP  from StudentBindPaperTypeEntity where TimeTamp>=@timetamp and IsUse='1'";
            SqlParameter[] paras = new SqlParameter[]{
                new SqlParameter ("@timetamp",studentBindPaperType.TimeTamp)
            };
            DataTable dt = sqlhelper.ExecuteQuery(sql, paras, CommandType.Text);
            return dt;


        }
        #endregion

        #region 二次登陆，更新 binding表中的 IP -赵崇-2016年1月8日14:43:47
        /// <summary>
        /// 二次登陆，更新 binding表中的 IP
        /// </summary>
        /// <param name="studentBindPaperTypeEntity"></param>
        public void updateLoginIP(StudentBindPaperTypeEntity studentBindPaperTypeEntity)
        {
            string sql = "update StudentBindPaperTypeEntity set IP=@IP where StudentID=@studentID and IsUse='1'";
            SqlParameter[] paras = new SqlParameter[]{
                new SqlParameter ("@IP",studentBindPaperTypeEntity.IP),
                new SqlParameter ("@studentID",studentBindPaperTypeEntity.StudentID)
            };
            DataTable dt = sqlhelper.ExecuteQuery(sql, paras, CommandType.Text);
        }
        #endregion

        #region 根据考场、时间戳查询正在考试的学生的sql语句---赵寒--2016年1月4日08:35:52
        /// <summary>
        /// select--赵寒
        /// </summary>
        /// <param name="studentinfo"></param>
        /// <returns>学号，IP</returns>
        public DataTable OnLineStudentbyPlace(StudentBindPaperTypeEntity studentBindPaperType, string strPlace)
        {
            string sql = "select StudentID as '学号',IP from StudentBindPaperTypeEntity where IP like @place and TimeTamp>=@timetamp and IsUse='1' AND StudentID in (Select StudentID from StudentInfoEntity)";

            SqlParameter[] paras = new SqlParameter[]{
                new SqlParameter ("@timetamp",studentBindPaperType.TimeTamp),
                new SqlParameter("@place",strPlace+"%")
            };
            DataTable dt = sqlhelper.ExecuteQuery(sql, paras, CommandType.Text);
            return dt;


        }
        #endregion

        #region 查询所有低分的考生信息 修改人：李金颖-低分查询SQL语句修正，添加限制条件-2018-12-15 10:45:59
        //原注释：查询所有考生的信息
        /// <summary>
        /// 查询所有低分的考生信息
        /// </summary>
        /// <returns></returns>
        public DataTable GetPlaces(string startTime, string endTime,string Sore)
        {
            StringBuilder sbSql = new StringBuilder();
            sbSql.Append(" SELECT ")
            .Append(" se.studentID, ")
            .Append(" se.studentName, ")
            .Append(" sb.PaperType, ")
            .Append(" sb.IP, ")
            .Append(" score.score, ")
            .Append(" score.timeSpan ")
            .Append(" FROM ")
            .Append(" StudentBindPaperTypeEntity sb ")
            .Append(" inner JOIN StudentInfoEntity se  ON se.studentID = sb.StudentID ")
            .Append(" left JOIN ScoreEntity score on score.studentID=se.studentID and score.timeSpan=sb.TimeTamp")
            .Append(" where CONVERT(varchar(50),timeSpan,120) BETWEEN CONVERT(varchar(50),'" + startTime + "',120) and CONVERT(varchar(50),'" + endTime + "',120) and  score.timeSpan in (select timeSpan from ScoreEntity se where se.studentID = sb.StudentID) and (score.score < " + Sore+ "  OR score.score is null)")
            .Append(" ");
            DataTable dt = sqlhelper.ExecuteQuery(sbSql.ToString(), CommandType.Text);
            if (dt == null)
            {
                return null;
            }
            return dt;
        }
        #endregion

        #region  查询所有学生的总分数
        public DataTable GetScore()
        {
            string sql = " SELECT * from ScoreEntity";
            DataTable dt = sqlhelper.ExecuteQuery(sql, CommandType.Text);
            if (dt == null)
            {
                return null;
            }
            //TBToList<ScoreEntity> dtToList = new TBToList<ScoreEntity>();
            //return dtToList.ToList(dt);
            return dt;
        }
        #endregion

        #region 查询所有在线或交卷的学生_吕德彪
        /// <summary>
        /// 查询所有学生
        /// </summary>
        /// <param name="studentBindPaperTypeEntity"></param>
        /// <param name="studentinfo"></param>
        /// <returns></returns>
        public DataTable AllOnlineStudent(StudentBindPaperTypeEntity studentBindPaperType)
        {
            DataTable dt = new DataTable();
            //string sql = "SELECT a.StudentID,a.PaperType,case a.IsUse when '0' then '已交卷' when '1' then '在线' else '未上传' end,c.CollegeName,a.TimeTamp,a.IP,b.examPlaceID,b.studentName,b.major,b.majorClass FROM StudentBindPaperTypeEntity as a INNER JOIN StudentInfoEntity as b ON a.StudentID = b.studentID INNER JOIN CollegeEntity as c ON a.CollegeID =c.CollegeID where TimeTamp>=@timetamp and IsUse = @IsUse ORDER BY b.examPlaceID ";
            string sql = "SELECT a.StudentID,a.PaperType,case a.IsUse when '0' then '已交卷' when '1' then '在线' else '未上传' end,c.CollegeName,a.TimeTamp,a.IP,b.examPlaceID,b.studentName,b.major,b.majorClass,a.ExamModel FROM StudentBindPaperTypeEntity as a INNER JOIN StudentInfoEntity as b ON a.StudentID = b.studentID INNER JOIN CollegeEntity as c ON a.CollegeID =c.CollegeID where TimeTamp>=@timetamp and IsUse = @IsUse ORDER BY b.examPlaceID ";
            SqlParameter[] paras = new SqlParameter[]{
                new SqlParameter ("@timetamp",studentBindPaperType.TimeTamp),
                new SqlParameter("@IsUse",studentBindPaperType.IsUse)
            };
            dt = sqlhelper.ExecuteQuery(sql, paras, CommandType.Text);
            return dt;
        }
        #endregion    

        #region 根据考场、时间戳查询正在考试的学生的sql语句-吕德彪
        /// <summary>
        /// select--吕德彪
        /// </summary>
        /// <param name="studentinfo"></param>
        /// <returns>学号，IP</returns>
        public DataTable OnLineStudentBy(StudentBindPaperTypeEntity studentBindPaperType, string strPlace,TimeEntity timeEntity)
        {
            //string sql = "SELECT a.StudentID,a.PaperType,case a.IsUse when '0' then '已交卷' when '1' then '在线' else '未上传' end,c.CollegeName,a.TimeTamp,a.IP,b.examPlaceID,b.studentName,b.major,b.majorClass FROM StudentBindPaperTypeEntity as a INNER JOIN StudentInfoEntity as b ON a.StudentID=b.studentID INNER JOIN CollegeEntity as c ON a.CollegeID=c.CollegeID where IP like @place and TimeTamp between @timetamp and @endDateTime and IsUse = @IsUse ORDER BY b.examPlaceID ";
            string sql = "SELECT a.StudentID,a.PaperType,case a.IsUse when '0' then '已交卷' when '1' then '在线' else '未上传' end,c.CollegeName,a.TimeTamp,a.IP,b.examPlaceID,b.studentName,b.major,b.majorClass,a.ExamModel FROM StudentBindPaperTypeEntity as a INNER JOIN StudentInfoEntity as b ON a.StudentID=b.studentID INNER JOIN CollegeEntity as c ON a.CollegeID=c.CollegeID INNER JOIN IPEntity as d ON b.examPlaceID = d.ipName where b.examPlaceID = @place and TimeTamp between @timetamp and @endDateTime and IsUse = @IsUse ORDER BY b.examPlaceID ";

            SqlParameter[] paras = new SqlParameter[]{
                new SqlParameter ("@timetamp",studentBindPaperType.TimeTamp),
                //new SqlParameter("@place",strPlace+"%"),
                new SqlParameter("@place",strPlace),
                new SqlParameter("@endDateTime",timeEntity.EndDateTime),
                new SqlParameter("@IsUse",studentBindPaperType.IsUse)
            };
            DataTable dt = sqlhelper.ExecuteQuery(sql, paras, CommandType.Text);
            return dt;
        }
        #endregion

        #region 查询未交卷学生-吕德彪
        public DataTable NotSubmitStudent(TimeEntity timeEntity)
        {
            //string sql = "SELECT a.StudentID,a.PaperType,case a.IsUse when '0' then '已交卷' when '1' then '在线' else '未上传' end,c.CollegeName,a.TimeTamp,a.IP,b.examPlaceID,b.studentName,b.major,b.majorClass FROM StudentBindPaperTypeEntity as a INNER JOIN StudentInfoEntity as b ON a.StudentID = b.studentID INNER JOIN CollegeEntity as c ON a.CollegeID =c.CollegeID where IsUse = '1' and b.studentID = @search or studentName = @search or major = @search or majorClass = @search or collegeName = @search ORDER BY b.examPlaceID ";
            string sql = "SELECT a.StudentID,a.PaperType,case a.IsUse when '0' then '已交卷' when '1' then '在线' else '未上传' end,c.CollegeName,a.TimeTamp,a.IP,b.examPlaceID,b.studentName,b.major,b.majorClass,a.ExamModel FROM StudentBindPaperTypeEntity as a INNER JOIN StudentInfoEntity as b ON a.StudentID = b.studentID INNER JOIN CollegeEntity as c ON a.CollegeID =c.CollegeID where IsUse = '1' and b.studentID = @search or studentName = @search or major = @search or majorClass = @search or collegeName = @search ORDER BY b.examPlaceID ";            
            SqlParameter[] paras = new SqlParameter[]{
                new SqlParameter ("@search",timeEntity.Search)
                
            };
            DataTable dt = sqlhelper.ExecuteQuery(sql, paras, CommandType.Text);
            return dt;
        }
        #endregion

        #region 查询在时间段内的所有学生
        /// <summary>
        /// 查询在时间段内的所有学生
        /// </summary>
        /// <param name="studentBindPaperType"></param>
        /// <param name="timeEntity"></param>
        /// <returns></returns>
        public DataTable AllStudent(StudentBindPaperTypeEntity studentBindPaperType, TimeEntity timeEntity)
        {
            DataTable dt = new DataTable();
            string sql = "SELECT a.StudentID,a.PaperType,case a.IsUse when '0' then '已交卷' when '1' then '在线' else '未上传' end,c.CollegeName,a.TimeTamp,a.IP,b.examPlaceID,b.studentName,b.major,b.majorClass,a.ExamModel FROM StudentBindPaperTypeEntity as a INNER JOIN StudentInfoEntity as b ON a.StudentID = b.studentID INNER JOIN CollegeEntity as c ON a.CollegeID =c.CollegeID where TimeTamp between @timetamp and @endDateTime ORDER BY b.examPlaceID ";
            SqlParameter[] paras = new SqlParameter[]{
                new SqlParameter ("@timetamp",studentBindPaperType.TimeTamp),
                new SqlParameter("@endDateTime",timeEntity.EndDateTime)
            };
            dt = sqlhelper.ExecuteQuery(sql, paras, CommandType.Text);
            return dt;
        }
        #endregion

        #region 查询各考场的所有学生
        /// <summary>
        /// 查询各考场的所有学生
        /// </summary>
        /// <param name="studentBindPaperType"></param>
        /// <param name="strPlace"></param>
        /// <param name="timeEntity"></param>
        /// <returns></returns>
        public DataTable PlaceAllStudent(StudentBindPaperTypeEntity studentBindPaperType, string strPlace, TimeEntity timeEntity)
        {
            string sql = "SELECT a.StudentID,a.PaperType,case a.IsUse when '0' then '已交卷' when '1' then '在线' else '未上传' end,c.CollegeName,a.TimeTamp,a.IP,b.examPlaceID,b.studentName,b.major,b.majorClass,a.ExamModel FROM StudentBindPaperTypeEntity as a INNER JOIN StudentInfoEntity as b ON a.StudentID=b.studentID INNER JOIN CollegeEntity as c ON a.CollegeID=c.CollegeID INNER JOIN IPEntity as d ON b.examPlaceID = d.ipName where b.examPlaceID = @place and TimeTamp between @timetamp and @endDateTime ORDER BY b.studentID ";
            SqlParameter[] paras = new SqlParameter[]{
                new SqlParameter ("@timetamp",studentBindPaperType.TimeTamp),
                new SqlParameter("@place",strPlace),
                new SqlParameter("@endDateTime",timeEntity.EndDateTime)
            };
            DataTable dt = sqlhelper.ExecuteQuery(sql, paras, CommandType.Text);
            return dt;
        }
        #endregion

        #region 根据学号查询绑定表-吕德彪
        /// <summary>
        /// 根据学号查询绑定表-吕德彪
        /// </summary>
        /// <param name="studentID"></param>
        /// <returns></returns>
        public DataTable SelectByStudentID(string studentID)
        {
            string sql = "SELECT * from StudentBindPaperTypeEntity where studentID = @StudentID order by TimeTamp desc";
            SqlParameter[] paras = new SqlParameter[]{
                new SqlParameter ("@StudentID",studentID)               
            };
            DataTable dt = sqlhelper.ExecuteQuery(sql, paras, CommandType.Text);
            return dt;
        }
        #endregion

    }
}
